import React, {FC, useEffect} from 'react';
import {useNavigate} from 'react-router-dom';
import './index.css';
import {Button, Typography} from 'antd';
import axios from 'axios';

/**
 * 首页页面
 */
const Home: FC = () => {
	const navigate = useNavigate();
	const {Paragraph} = Typography;

	/**
	 * 页面初始化调用
	 */
	useEffect(() => {
		axios.get('/api/test').then(r => console.log(r.data));
	}, []);

	return (
		<div className="home">
			<h1 className="home-title">
				问卷调查 | 在线投票
			</h1>
			<Paragraph>
				累计创建 200 份，发布问卷 94 份，收到答卷 902 份
			</Paragraph>
			<Button type="primary" size="large" onClick={() => navigate('/manage/list')}>
				开始使用
			</Button>
		</div>
	);
};

export default Home;